print("------------ drop ------------")
let array1 = [5, 2, 1, 12, 234, 55, 67, 21, 5676, 123]
let array2 = array1.dropFirst(1)
let array3 = array1.dropLast(2)
// 扔掉小于15的值, 到第一个大于15的位置开始
let array4 = array1.drop{ $0 < 15 }
print(array1)
print(array2)
print(array3)
print(array4)

print("------------ prefix ------------")
// 获取前5个元素
let array5 = array1.prefix(5)
// 获取到下标为4的元素止, 不包含4
let array6 = array1.prefix(upTo: 4)
// 获取到下标为4的元素止, 包含4
let array7 = array1.prefix(through: 4)
let array8 = array1.prefix{ $0 < 15 }
print(array5)
print(array6)
print(array7)
print(array8)

print("------------ suffix ------------")
let array9 = array1.suffix(5)
let array10 = array1.suffix(from: 3)
print(array9)
print(array10)

print("------------ range ------------")
let array11 = array1[1...3]
let array12 = array1[...]
print(array11)
print(array12)

print("------------ ArraySlice转Array ------------")
let array13 = Array(array11)
print(array13)
